<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<link rel="icon" href="../img/system/icon/Exchange-logo.jpg" type="image/x-icon">
		<title>易置-物品信息页</title>
		<link rel="stylesheet" type="text/css" href="../css/goods_details.css"/>
	</head>
	<body>
		<div class="wrapper">
			<!--顶两侧到头-->
			<div class="inside">
				<!--顶部-->
				<div class="header">
					<span id="address">当前位置：推荐信息，注册登录后获取更多定位信息</span>
					<!--<ul>-->
						<!--<li>您好，请</li>
						<li><a href="login.html">登录</a></li>
						<li><a href="login.html">免费注册</a>&nbsp;&nbsp;|</li>-->
						<!--<li>购物车&nbsp;&nbsp;|</li>
						<li>我的订单&nbsp;&nbsp;|</li>-->
						<!--<li><a href="login.html">消息</a></li>-->
					<!--</ul>-->
				</div>
			</div>
			<div class="inside02">
				<!--logo-->
				
				<div class="header_logo">
					<?php
//					$goods_id=$_POST['goods_id'];//获取来自login.html页面表单提交的username文本框中的数据
					$goods_id=$_POST['goods_id'];
					$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
					or die("无法连接到数据库");
					mysqli_query($db,"set names 'utf8'");
					$q="SELECT * FROM tb_user WHERE username IN (SELECT username FROM tb_goods WHERE goods_id='".$goods_id."' )";//定义一条SQL文件，以表单提交的username文本框中的数据为条件从tb_login表格查询数据
					$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，将结果返回给$result
					if ($result->num_rows > 0) {
  					// 输出数据
  					while($row = $result->fetch_assoc()) {
					$user_nickname=$row["user_nickname"];
					$userlogo_path=$row["userlogo_path"];
 			 		}
					}else{
  					echo "暂无卖家数据";
					}
					mysqli_close($db);
					?>
					<img class="logo" src="../img/user/icon-user/<?php echo $userlogo_path?>" />
					<span id="user_storename"><?php echo $user_nickname?>发布的物品</span>
					<span id="user_more">更多></span>
					<form action="goods_all_search_onlogin.php" method="post">
						<input type="text" name="goods_name" id="search_header" />
						<!--<div class="search">搜索</div>-->
						<input class="search" type="submit" name="submit" value="搜索"/>
					</form>
				</div>
				<!--导航栏-->
				<div class="nav">
					<div class="nav_first">
						所有物品
					</div>
					<ul>
						<li id="home"><a href="index.php">首页</a></li>
						<li>|</li>
						<li id="now">当前</li>
						<!--<li>|</li>
						<li>新品</li>-->
					</ul>
				</div>
			</div>
			<!--图片(三层嵌套：1层大部分外围，2层小部分外围，3层整体居中)-->
			<?php
//					$goods_id=$_POST['goods_id'];//获取来自login.html页面表单提交的username文本框中的数据
					$goods_id=$_POST['goods_id'];
					$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
					or die("无法连接到数据库");
					mysqli_query($db,"set names 'utf8'");
					$q="SELECT * FROM tb_goods WHERE goods_id='".$goods_id."' ";//定义一条SQL文件，以表单提交的username文本框中的数据为条件从tb_login表格查询数据
					$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，将结果返回给$result
					if ($result->num_rows > 0) {
  					// 输出数据
  					while($row = $result->fetch_assoc()) {
					$img_pathi=$row["img_path"];
					$goods_name=$row["goods_name"];
					$goods_money=$row["goods_money"];
					$quality=$row["quality"];
					$school_address=$row["school_address"];
					$exchange_way=$row["exchange_way"];
					$number=$row["number"];
					$contact_phone=$row["contact_phone"];
					$contact_qq=$row["contact_qq"];
					$contact_wechat=$row["contact_wechat"];
					$exchange_status=$row["exchange_status"];
 			 		}
					}else{
  					echo "暂无卖家数据";
					}
					mysqli_close($db);
			?>
			<div class="inside03">
				<!--<img src="img/index01.jpg"/>-->
				<div class="goods_infos">
					<div class="goods_img">
						<img id="big_img01" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						<img id="big_img02" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						<img id="big_img03" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						<img id="big_img04" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						<img id="big_img05" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
					</div>
					<div class="goods_info">
							<span id="goods_name"><?php echo $goods_name; ?></span>
						<div class="attribute">	
							<span id="goods_money">转卖价：</span>
							<span id="goods_quality">品质：</span>
							<span id="goods_address">所在地：</span>
							<span id="goods_transaction">交易方式：</span>
							<span id="goods_amount">数量：</span>
							<span id="goods_phone">电话：</span>
							<span id="goods_qq">QQ：</span>
							<span id="goods_wechat">微信：</span>
							<span id="goods_status">状态：</span>
						</div>
						<div class="value">
							<span id="goods_money_value">￥<?php echo $goods_money; ?>.00</span>
							<span id="goods_quality_value"><?php echo $quality; ?></span>
							<span id="goods_address_value"><?php echo $school_address; ?></span>
							<span id="goods_transaction_value"><?php echo $exchange_way; ?></span>
							<span id="goods_amount_value"><?php echo $number; ?>件</span>
							<span id="goods_phone_value"><?php echo $contact_phone; ?></span>
							<span id="goods_qq_value"><?php echo $contact_qq; ?></span>
							<span id="goods_wechat_value"><?php echo $contact_wechat; ?></span>
							<span id="goods_status_value"><?php echo $exchange_status; ?></span>
						</div>
						<div class="collect_div">
							<!--<form action="" method="post">-->
								<input name="user_id" id="user_id" value="" />
								<input name="goods_id" id="goods_id" value="" />
								<input type="submit" id="insert01" value="+添加收藏"/>
							</form><br />
							<!--<form action="" method="post">-->
								<input name="user_id" id="user_id" value="" />
								<input name="goods_id" id="goods_id" value="" />
								<input type="submit" id="insert02" value="取消收藏"/>
							</form>
						</div>
						<div class="concern_div">
							<!--<form action="" method="post">-->
								<input name="user_id" id="user_id" value="" />
								<input name="goods_id" id="goods_id" value="" />
								<input type="submit" id="insert03" value="+添加关注"/>
							</form><br />
							<!--<form action="" method="post">-->
								<input name="user_id" id="user_id" value="" />
								<input name="goods_id" id="goods_id" value="" />
								<input type="submit" id="insert04" value="取消关注"/>
							</form>
						</div>
					</div>
					<div class="goods_little_img">
						<div class="little_imges">
							<img id="little_img01" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						</div>
						<div class="little_imges">
							<img id="little_img02" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						</div>
						<div class="little_imges">
							<img id="little_img03" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						</div>
						<div class="little_imges">
							<img id="little_img04" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						</div>
						<div class="little_imges">
							<img id="little_img05" src="../img/system/goods/<?php echo $img_pathi; ?>"/>
						</div>
					</div>
				</div>
			</div>
			<!--分类导航栏-->
			<div class="inside04">
				<div class="nav02" id="fenlei">
					<ul>
						<li class="nav02_first">卖家留言</li>
						<li class="nav02_second">评论</li>
					</ul>
				</div>
				<div class="seller">
					<div class="words"><br />
						<p id="warning">如遇到以下情况可能是诈骗行为：<b>1.宝贝价格异常低；2.卖家的提货位置在校外；3.卖家要求直接汇款。 </b></p>
						<span id="seller_words">卖家留言:</span>
						<span id="">
							感兴趣的话联系我！价格上可以私聊的。
						</span>
					</div>
					<div class="discuss"><br />
						<p id="warning02">如遇到以下情况可能是诈骗行为：<b>1.宝贝价格异常低；2.卖家的提货位置在校外；3.卖家要求直接汇款。 </b></p>
						<span id="seller_discuss">评论:</span>
						<span id="">
							<?php
								$goods_id=$_POST['goods_id'];
								$db=@mysqli_connect('localhost','root','123456','db_exchange')//利用mysqli_connect()连接到数据库
								or die("无法连接到数据库");
								mysqli_query($db,"set names 'utf8'");
								$q="SELECT * FROM tb_discuss WHERE goods_id='".$goods_id."' ";//定义一条SQL文件，以表单提交的username文本框中的数据为条件从tb_login表格查询数据
								$result=mysqli_query($db,$q);//利用mysqli_query()来执行上面的SQL文件，将结果返回给$result
								if ($result->num_rows > 0) {
  								// 输出数据
  									while($row = $result->fetch_assoc()) {
   									$goods_discussi=$row["goods_discuss"];
 			 						echo '用户的评论：'.$goods_discussi . "<br />";
 			 						}
								}else{
  								echo "暂无用户评论，抢沙发！". "<br />";
								}
								mysqli_close($db);
							?>
						</span><br />
						<form action="../model/discuss_ok.php" method="post">
							<input name="goods_id" style="display: none;" value="<?php echo $goods_id; ?>" />
							<input type="text" name="goods_discuss" id="discuss_text" value="" />
							<input type="submit" name="discuss_btn" id="discuss_btn" value="评论" /><br /><br />
							<p style="font-size: 12px;color: cornflowerblue;">提示：发布完评论后，需刷新本页面才能查看到您的评论信息哦！</p>
						</form>
					</div>
				</div>
				<!--底部-->
				<div class="footer">
					<div class="one">
						<span class="buy">购物指南</span>
						<span>购买流程</span>
						<span>常见问题</span>
						<span>联系客服</span>
						<span>物品发布</span>
						<span>发布问题</span>
					</div>
					<div class="one">
						<span class="buy">配送方式</span>
						<span>上门自提</span>
						<span>快递配送</span>
						<span>送货上门</span>
					</div>
					<div class="one">
						<span class="buy">支付方式</span>
						<span>在线支付</span>
						<span>货到付款</span>
						<span>分期付款</span>
					</div>
					<div class="one">
						<span class="buy">售后服务</span>
						<span>售后政策</span>
						<span>退款说明</span>
						<span>取消订单</span>
					</div>
				</div>
				<div class="footer02">
					<ul>
						<li>关于我们&nbsp;&nbsp;&nbsp;&nbsp;</li>
						<li>联系我们&nbsp;&nbsp;&nbsp;&nbsp;</li>
						<li>诚招英才&nbsp;&nbsp;&nbsp;&nbsp;</li>
						<li>论坛&nbsp;&nbsp;&nbsp;&nbsp;</li>
						<li>友情链接&nbsp;&nbsp;&nbsp;&nbsp;</li>
						<li>相关产品</li>
					</ul>
				</div>
				<div class="footer02_about">
					<hr />
					<ul>
						<li>用户协议&nbsp;&nbsp;|&nbsp;&nbsp;</li>
						<li>隐藏协议&nbsp;&nbsp;|&nbsp;&nbsp;</li>
						<li>Copyright © 2019  易置开发团队版权所有</li>
					</ul>
				</div>
			</div>
			<!--<div class="nav03">
				<a href="./html/Personal.html"><img id="user" src="../img/user.jpg" /></a>
				<a href="#"><img id="shopping" src="../img/shopping.jpg" /></a>
				<a href="#"><img id="store" src="../img/store.jpg" /></a>
				<a href="#"><img id="like" src="../img/like.jpg" /></a>
				<a href="#"><img id="collect" src="../img/collect.jpg" /></a>
				<a href="#"><img id="history" src="../img/history.jpg" /></a>
				<a href="#"><img id="advice" src="../img/advice.jpg" /></a>
				<a href="#address"><img id="top" src="../img/top.jpg" /></a>
			</div>
			<div class="nav04">
				<div class="user">个人中心</div>
				<div class="shopping">购物车</div>
				<div class="store">我的店铺</div>
				<div class="like">喜欢</div>
				<div class="collect">收藏</div>
				<div class="history">历史</div>
				<div class="advice">意见反馈</div>
				<a href="#address"><div class="address">返回顶部</div></a>
			</div>-->
		</div>
	<script src="../js/jquery-3.4.1.js"></script>
	<script src="../js/goods_details.js"></script>
    <script src="js/index.js"></script>
	</body>
</html>